import 'package:flutter/material.dart';
import 'package:niu_app/configs/app_style_config.dart';
import 'package:niu_app/pages/model/homepage/team_model.dart';
import 'package:niu_app/views/homepage/team_widget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:niu_app/views/homepage/team_widget1.dart';
import 'package:niu_app/views/jk/jk_text.dart';
class team_Page extends StatefulWidget {
  @override
  _team_PageState createState() => _team_PageState();
}

class _team_PageState extends State<team_Page> {
  List notice=[
    {"title":"团队","number":"99"},
    {"title":"直接","number":"70"},
    {"title":"间接","number":"29"},
    {"title":"分成","number":"1,555.55"},
    {"title":"今日","number":"0.00"},
    {"title":"昨日","number":"0.00"},
    {"title":"跟单","number":"99.00"},
    {"title":"今日","number":"0.00"},
    {"title":"昨日","number":"0.00"},
  ];

  List notice1=[
    {
      "url":"assets/boy3.png",
      "title1":"牛了吧唧的牛人牛牛牛",
      "time1":"2020/07/20",
      "time2":"20:47:30",
      "title2":"已绑定",
      "title3":"已跟单",
      "color":AppStyleConfig.background,
      "title4":"直接",
      "number1":"0.00",
      "number2":"0.00",
      "number3":"0.00"
    },
    {
      "url":"assets/boy4.png",
      "title1":"牛了吧唧的牛人牛牛牛",
      "time1":"2020/07/20",
      "time2":"20:47:30",
      "title2":"已绑定",
      "title3":"未跟单",
      "color":AppStyleConfig.color9,
      "title4":"直接",
      "number1":"0.00",
      "number2":"0.00",
      "number3":"0.00"
    }
  ];



  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Container(
            height: 194.w,
            child: center(),
          ),
          Divider(color: AppStyleConfig.color2.withOpacity(0.4),thickness: 5.0.w,),
          bottom(),
        ],
      ),
    );
  }
  Widget center(){
    return  Column(
      children: [
        Expanded(
          child: GridView.builder(
            physics: NeverScrollableScrollPhysics(),
            shrinkWrap: true,
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 3, //横轴三个子widget
                childAspectRatio:2.4 //宽高比为1时，子widget
            ),
            itemBuilder: (context,index){
              return teamWidget(
                datamodel: teammodel.fromJson(notice[index]),
              );
            },
            itemCount: notice.length,
          ),
        ),

      ],
    );
  }
  Widget bottom(){
    return Column(
      children: [
      Container(
          padding: EdgeInsets.fromLTRB(17,10,17,0),
        child:  Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            JKText(
              data: "团队成员",
              fontSize: 14.w,
            ),
            Icon(Icons.person,size: 14.w,)
          ],
        ),
      ),
        Container(
        height: 400.h,
        child: MediaQuery.removePadding(
          context: context,
          removeTop: true,
          child:  ListView.builder(
            shrinkWrap: true,
            scrollDirection: Axis.vertical,
            physics:NeverScrollableScrollPhysics(),
            itemBuilder: (context,index){
              return team1widget(
                datamodel: teammodel.fromJson(notice1[index]),
              );
            },
            itemCount: notice1.length,
          ),)
        ),
      ],
    );
  }
}
